package com.example.qxfw.hbqx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.TownShipForecastTemp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
@DS("qx")
public interface TownshipForecasttempMapper extends BaseMapper<TownShipForecastTemp> {
    /**
     * 根据日期时效时次站点id查询乡镇预报临时表
     * @param datechar 日期
     * @param ntimes 时效
     * @param timechar 时次
     * @param stationid 站点编号
     * @return
     */
    @Select("SELECT StationName, datechar, ntimes " +
            "FROM township_forecasttemp " +
            "WHERE datechar = #{datechar} " +
            "AND ntimes IN (#{ntimes}) " +
            "AND timechar = #{timechar} " +
            "AND stationid IN (#{stationid}) " +
            "ORDER BY datechar ")
    List<TownShipForecastTemp> selectByIdNtimesDatecharTimechar(Date datechar, Integer ntimes, String timechar, String stationid);


}
